<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:constants="http://www.tuanzi.com/constants/tags"
                xmlns:h="http://java.sun.com/jsf/html">
    <div class="ui-g">
        <div class="ui-g-12"><h3><b>甲方基础信息</b></h3></div>
        <div class="ui-g-2">
            <p:outputLabel for="name" value="甲方产品名称"/>
        </div>
        <div class="ui-g-4">
            <p:inputText id="name" value="#{firstPartyTagInfoBean.$.name}"
                         disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>
        <div class="ui-g-2">
            <p:outputLabel for="approvalType" value="审核方式"/>
        </div>
        <div class="ui-g-4">
            <p:selectOneMenu id="approvalType" value="#{firstPartyTagInfoBean.$.approvalType}"
                             filter="true"
                             filterMatchMode="contains" disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                              noSelectionOption="true"/>
                <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.APPROVAL_TYPE]}" var="dic"
                               itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
            </p:selectOneMenu>
        </div>
        <div class="ui-g-2">
            <p:outputLabel for="promotionType" value="推广模式"/>
        </div>
        <div class="ui-g-4">
            <p:selectOneMenu id="promotionType"
                             value="#{firstPartyTagInfoBean.$.promotionType}" filter="true"
                             filterMatchMode="contains" disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                              noSelectionOption="true"/>
                <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.PROMOTION_TYPE]}"
                               var="dic"
                               itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
            </p:selectOneMenu>
        </div>
        <div class="ui-g-2">
            <p:outputLabel value="甲方营业执照"/>
        </div>
        <div class="ui-g-1">
            <p:graphicImage url="#{firstPartyTagInfoBean.$.businessLicense}" width="80"/>
        </div>
        <div class="ui-g-3">
            <p:fileUpload fileUploadListener="#{firstPartyTagInfoBean.onUploadBusinessLicense}"
                          mode="advanced"
                          fileLimit="1"
                          auto="true"
                          fileLimitMessage="只能上传一个文件"
                          invalidFileMessage="不支持上传文件类型"
                          invalidSizeMessage="文件过大"
                          sizeLimit="#{constants:get('UPLOAD_FILE_SIZE')}"
                          allowTypes="/(\.|\/)(#{constants:get('UPLOAD_FILE_SUFFIX')})$/"
                          label="上传" update="@form" process="@form" disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="company" value="甲方公司名称"/>
        </div>
        <div class="ui-g-4">
            <p:selectOneMenu id="company" value="#{firstPartyTagInfoBean.$.companyId}"
                             filter="true"
                             filterMatchMode="contains" disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                              noSelectionOption="true"/>
                <f:selectItems value="#{firstPartyTagInfoBean.companyList}" var="company"
                               itemLabel="#{company.companyName}" itemValue="#{company.id}"/>
            </p:selectOneMenu>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="dailyClickUvLimitation" value="每日上限控量"/>
        </div>
        <div class="ui-g-4">
            <p:inputText id="dailyClickUvLimitation" value="#{firstPartyTagInfoBean.$.dailyClickUvLimitation}"
                         disabled="#{firstPartyTagInfoBean.isView()}">
                <p:keyFilter regEx="/[\d]/"/>
            </p:inputText>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="autoOnline" value="明日是否自动上线"/>
        </div>
        <div class="ui-g-4">
            <p:selectOneButton id="autoOnline" value="#{firstPartyTagInfoBean.$.autoOnline}"
                               disabled="#{firstPartyTagInfoBean.isView()}">
                <p:ajax event="change" listener="#{firstPartyTagInfoBean.onChangeAutoOnline}" update="autoOnlineTime"/>
                <f:selectItem itemLabel="是" itemValue="true"/>
                <f:selectItem itemLabel="否" itemValue="false"/>
            </p:selectOneButton>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="autoOnlineTime" value="自动上线时间"/>
        </div>
        <div class="ui-g-4">
            <p:calendar
                    id="autoOnlineTime" styleClass="autoWidthCalendar"
                    value="#{firstPartyTagInfoBean.$.autoOnlineTime}"
                    locale="#{constants:get('LOCALE')}"
                    timeZone="#{constants:get('TIME_ZONE')}"
                    pattern="HH:mm"
                    timeOnly="true"
                    disabled="#{!firstPartyTagInfoBean.$.autoOnline or firstPartyTagInfoBean.isView()}"/>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="cooperation" value="合作机构"/>
        </div>
        <div class="ui-g-4">
            <p:inputText id="cooperation" value="#{firstPartyTagInfoBean.$.cooperation}"
                         disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="cooperation_desc" value="合作机构描述"/>
        </div>
        <div class="ui-g-4">
            <p:inputText id="cooperation_desc" value="#{firstPartyTagInfoBean.$.cooperationDesc}"
                         disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="partnerAgreement" value="甲方注册协议"/>
        </div>
        <div class="ui-g-4">
            <p:inputText id="partnerAgreement" value="#{firstPartyTagInfoBean.$.partnerAgreement}"
                         disabled="#{firstPartyTagInfoBean.isView()}"/>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="productType" value="甲方类型"/>
        </div>
        <div class="ui-g-4">
            <p:selectOneMenu id="productType"
                             value="#{firstPartyTagInfoBean.$.productType}" filter="true"
                             filterMatchMode="contains" disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                              noSelectionOption="true"/>
                <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.PRODUCT_TYPE]}"
                               var="dic"
                               itemLabel="#{dic.name}" itemValue="#{dic.value1}"/>
            </p:selectOneMenu>
        </div>

        <div class="ui-g-12">
            <h3><b>甲方贷款类型</b></h3>
        </div>
        <div class="ui-g-12">
            <p:selectManyButton value="#{firstPartyTagInfoBean.$.loanType}"
                                disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.FIRST_PARTY_LOAN_TYPE]}"
                               var="dic"
                               itemLabel="#{dic.name}"
                               itemValue="#{dic.value1}"/>
            </p:selectManyButton>
        </div>
        <div class="ui-g-12">
            <h3><b>用户身份标签</b></h3>
        </div>
        <div class="ui-g-12">
            <p:selectManyButton value="#{firstPartyTagInfoBean.$.identity}"
                                disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.IDENTITY_TAG]}"
                               var="dic"
                               itemLabel="#{dic.name}"
                               itemValue="#{dic.value1}"/>
            </p:selectManyButton>
        </div>
        <div class="ui-g-12">
            <h3><b>信用卡标签</b></h3>
        </div>
        <div class="ui-g-12">
            <p:selectManyButton value="#{firstPartyTagInfoBean.$.credit}" disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.CREDIT_CARD_TAG]}" var="dic"
                               itemLabel="#{dic.name}"
                               itemValue="#{dic.value1}"/>
            </p:selectManyButton>
        </div>

        <div class="ui-g-12"><h3><b>借款基础信息</b></h3></div>
        <div class="ui-g-2"><p:outputLabel for="rateType" value="利率模式"/></div>
        <div class="ui-g-4">
            <p:selectOneMenu id="rateType" value="#{firstPartyTagInfoBean.$.rateType}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItem itemLabel="- 请选择 -" itemValue=""
                              noSelectionOption="true"/>
                <p:ajax event="change" process="@form" update="@form"/>
                <f:selectItems
                        value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.RATE_TYPE]}"
                        var="dic"
                        itemLabel="#{dic.name}"
                        itemValue="#{dic.value1}"/>
            </p:selectOneMenu>
        </div>
        <div class="ui-g-2"><p:outputLabel for="loanSpeed" value="最快放款时间"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputText id="loanSpeed" value="#{firstPartyTagInfoBean.$.loanSpeed}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                    <p:keyFilter regEx="/[\d]/"/>
                </p:inputText>
                <span class="input-group-addon">天</span>
            </div>
        </div>
        <div class="ui-g-2"><p:outputLabel for="minLimit" value="最低借款额度"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputNumber id="minLimit" value="#{firstPartyTagInfoBean.$.minLimit}"
                               disabled="#{firstPartyTagInfoBean.isView()}"/>
                <span class="input-group-addon">元</span>
            </div>
        </div>
        <div class="ui-g-2"><p:outputLabel for="maxLimit" value="最高借款额度"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputNumber id="maxLimit" value="#{firstPartyTagInfoBean.$.maxLimit}"
                               disabled="#{firstPartyTagInfoBean.isView()}"/>
                <span class="input-group-addon">元</span>
            </div>
        </div>
        <div class="ui-g-2">
            <p:outputLabel for="defaultAmount" value="默认借款额度"/>
        </div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputNumber id="defaultAmount" value="#{firstPartyTagInfoBean.$.defaultAmount}"
                               disabled="#{firstPartyTagInfoBean.isView()}"/>
                <span class="input-group-addon">
                    <h:outputText value="元"/>
                </span>
            </div>
        </div>

        <div class="ui-g-2">
            <p:outputLabel for="defaultTime" value="默认借款期限"/>
        </div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputText id="defaultTime" value="#{firstPartyTagInfoBean.$.defaultTime}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                    <p:keyFilter regEx="/[\d]/"/>
                </p:inputText>
                <span class="input-group-addon">
                    <h:outputText value="天" rendered="#{firstPartyTagInfoBean.$.rateType == 1}"/>
                    <h:outputText value="月" rendered="#{firstPartyTagInfoBean.$.rateType == 2}"/>
                </span>
            </div>
        </div>
        <div class="ui-g-2"><p:outputLabel for="minTerm" value="最短借款期限"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputText id="minTerm" value="#{firstPartyTagInfoBean.$.minTerm}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                    <p:keyFilter regEx="/[\d]/"/>
                </p:inputText>
                <span class="input-group-addon">
                    <h:outputText value="天" rendered="#{firstPartyTagInfoBean.$.rateType == 1}"/>
                    <h:outputText value="月" rendered="#{firstPartyTagInfoBean.$.rateType == 2}"/>
                </span>
            </div>
        </div>
        <div class="ui-g-2"><p:outputLabel for="maxTerm" value="最长借款期限"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputText id="maxTerm" value="#{firstPartyTagInfoBean.$.maxTerm}"
                             disabled="#{firstPartyTagInfoBean.isView()}">
                    <p:keyFilter regEx="/[\d]/"/>
                </p:inputText>
                <span class="input-group-addon">
                    <h:outputText value="天" rendered="#{firstPartyTagInfoBean.$.rateType == 1}"/>
                    <h:outputText value="月" rendered="#{firstPartyTagInfoBean.$.rateType == 2}"/>
                </span>
            </div>
        </div>


        <div class="ui-g-2"><p:outputLabel for="averagePrice" value="件均价"/></div>
        <div class="ui-g-4">
            <div class="input-group">
                <p:inputNumber id="averagePrice" value="#{firstPartyTagInfoBean.$.averagePrice}"
                               disabled="#{firstPartyTagInfoBean.isView()}"/>
                <span class="input-group-addon">元</span>
            </div>
        </div>

        <div class="ui-g-2"><p:outputLabel value="还款方式配置"/></div>
        <div class="ui-g-4">
            <p:selectManyButton value="#{firstPartyTagInfoBean.$.repaymentTypes}"
                                disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItem itemLabel="等额分期" itemValue="DENG_ER_FENG_QI"/>
                <f:selectItem itemLabel="随借随还" itemValue="SUI_JIE_SUI_HUAN"/>
                <f:selectItem itemLabel="先息后本" itemValue="XIAN_XI_HOU_BEN"/>
            </p:selectManyButton>
        </div>


        <div class="ui-g-12">
            <h3><b>借款所需资料</b></h3>
        </div>
        <div class="ui-g-12">
            <p:selectManyButton value="#{firstPartyTagInfoBean.$.loanNecessaryData}"
                                disabled="#{firstPartyTagInfoBean.isView()}">
                <f:selectItems value="#{firstPartyTagInfoBean.dictionaries[DictionaryCode.LOAN_NECESSARY_DATA]}"
                               var="dic"
                               itemLabel="#{dic.name}"
                               itemValue="#{dic.value1}"/>
            </p:selectManyButton>
        </div>
    </div>
</ui:composition>




